package priv.yiyuan.example.design.chain;

/**
 * 登陆请求上下文, 用于责任链中传递登录请求数据和处理结果
 *
 * @author YiYuan
 * @data 2025/10/10
 * @apoNote
 */
public class LoginContext {

    private String username;

    private String password;

    private String appPackageName;

    // 账号校验状态
    private boolean accountValid = false;

    private String tenantId;

    private String tenantName;

    private String token;

    private boolean success = false;

    private String errorMessage;

    public LoginContext(String username, String password, String appPackageName) {
        this.username = username;
        this.password = password;
        this.appPackageName = appPackageName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAppPackageName() {
        return appPackageName;
    }

    public void setAppPackageName(String appPackageName) {
        this.appPackageName = appPackageName;
    }

    public boolean isAccountValid() {
        return accountValid;
    }

    public void setAccountValid(boolean accountValid) {
        this.accountValid = accountValid;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    @Override
    public String toString() {
        return "[" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", appPackageName='" + appPackageName + '\'' +
                ", accountValid=" + accountValid +
                ", tenantId='" + tenantId + '\'' +
                ", tenantName='" + tenantName + '\'' +
                ", token='" + token + '\'' +
                ", success=" + success +
                ", errorMessage='" + errorMessage + '\'' +
                ']';
    }
}
